<extend name="Base/common"/>
<block name="workclass">
    <div class="worker-quotes">
</block>
<block name="body">
        <div class="content">
            <div class="title">提交报价</div>
            <!--<div class="steps step1"><span>基础报价信息</span><span>项目难点</span><span>类似案例提交</span><span>完成</span></div>-->
            <div class="baojia-form box clearfixnew">
                <ul>
                    <li class="item-li">
                        <div class="item-name">竞标报价</div>
                        <div class="item-input">
                            <input id="price" type="number" class="">
                            <div class="danwei">元</div>
                            <div class="is-danger" style="display: none;"></div>
                        </div>
                    </li>
                    <li class="item-li">
                        <div class="item-name">预计开发周期</div>
                        <div class="item-input">
                            <input id="duration" type="number" class=""> <div class="danwei">天</div>
                            <div class="is-danger" style="display: none;"> </div>
                        </div>
                    </li>
                    <!--<li class="item-li">
                        <div class="item-name">能否驻场</div>
                        <div class="item-input">
                            <div class="radio">
                                <i class="iconfont icon-radio-active"></i>
                                <i class="iconfont icon-radio-inactive"></i> 是
                            </div>
                            <div class="radio selected">
                                <i class="iconfont icon-radio-active"></i>
                                <i class="iconfont icon-radio-inactive"></i> 否
                            </div>
                            <div class="is-danger" style="display: none;"></div>
                        </div>
                    </li> &lt;!&ndash;&ndash;&gt;
                    <li class="item-li">
                        <div class="item-name">能否产出专业文档</div>
                        <div class="item-input">
                            <div class="radio">
                                <i class="iconfont icon-radio-active"></i>
                                <i class="iconfont icon-radio-inactive"></i> 是
                            </div>
                            <div class="radio selected">
                                <i class="iconfont icon-radio-active"></i>
                                <i class="iconfont icon-radio-inactive"></i> 否
                            </div>
                            <div class="doc-mes">
                                <div class="doc-title">什么是专业文档？</div>
                                <div class="doc-txt"> 产品经理：需要输出PRD，MRD，功能List，原型图 </div>
                            </div>
                            <div class="is-danger" style="display: none;"></div>
                        </div>
                    </li>-->
                </ul>
                <ul><!--  style="display: none;" -->
                    <li class="item-li">
                        <div class="item-name">联系人</div>
                        <div class="item-input">
                            <input id="username" type="text" class="">
                            <div class="is-danger" style="display: none;"> </div>
                        </div>
                    </li>
                    <li class="item-li">
                        <div class="item-name">联系方式</div>
                        <div class="item-input">
                            <input id="mobile" type="number" class="">
                            <div class="is-danger" style="display: none;"> </div>
                        </div>
                    </li>
                </ul>
                <ul>
                    <li class="item-li">
                        <div class="item-name">竞标方案</div>
                        <div class="item-input">
                            <textarea id="advantage" maxlength="120" placeholder="请认真填写竞标方案，才有可能获得发包方的青睐哦~~（限120字）" class=""></textarea>
                            <div class="is-danger" style="display: none;"></div>
                        </div>
                    </li>
                </ul>

                <div class="success" style="display: none;"><!-- -->
                    <i class="iconfont icon-selected"></i>
                    <p><strong>恭喜，报价已提交成功</strong></p>
                    <p>项目状态将以短信形式通知您<br>或扫码关注微信公众号，随时查看项目状态</p>
                    <a href="{:U('worker/my')}">查看我参与的项目</a>
                    <div class="qrcode"> <img src="__IMG__/qrcode.jpg"> <span>扫码关注微信公众号</span></div>
                </div>
            </div>
            <div class="btn" id="quotes">提交报价</div>
        </div>
        <div class="dialogSucc" style="display: none;"><!--  -->
            <div class="dialogSucc-content box">
                <div class="dialogSucc-text">恭喜您<br>已成功提交报价信息！</div>
                <div class="dialogSucc-more">完成入驻，提升中标几率</div>
                <a href="#" class="btn">完成入驻</a>
            </div>
        </div>
        <div class="dialogImgCode" style="display: none;"><!-- -->
            <div class="dialogImgCode-content box"><i class="iconfont icon-nav-close close"></i>
                <div class="dialogImgCode-text">请输入验证码</div>
                <img src="" class="dialogImgCode-img"> <input class="dialogImgCode-input">
                <div class="btn">提交</div>
            </div>
        </div>
</block>
<block name="script">
<script type="text/javascript">
    //'index-nav-show'
    (function() {
        var headerMenu = $('.header-menu');
        $('.icon-nav-menu').click(function(){
            headerMenu.addClass('menuShow');
        });
        $('.icon-nav-close').click(function(){
            headerMenu.removeClass('menuShow');
        });

        var setHeader = function() {
            var st = $(window).scrollTop();
            if(st > 0) {
                $('.header-pc').removeClass('header-transparent');
            } else {
                $('.header-pc').addClass('header-transparent');
            }
        };
        setHeader();
        $(window).scroll(function() {
            setHeader();
        });

        //表单提交
        $('#quotes').click(function () {
            var pro = {};
            pro.pid         = '{$pid}';
            pro.username    = $('#username').val();
            pro.mobile      = $('#mobile').val();
            pro.price       = $('#price').val();
            pro.duration    = $('#duration').val();
            pro.difficulty  = $('#difficulty').val();
            pro.solution    = $('#solution').val();
            pro.advantage   = $('#advantage').val();

            $.post("{:U('Worker/quotes')}", pro, function (data) {
                if( 1 == data.status ){
                    alert('发布成功');
                    window.location.href = "{:U('User/myworker')}";
                }else {
                    var errmsg = (data.info) ? data.info : '发布失败';
                    alert(errmsg);
                    return false;
                }
            }, 'json');
        });
    })();
</script>
</block>